// 表单字段类型
export type FormFieldType =
  | 'input'
  | 'textarea'
  | 'select'
  | 'radio'
  | 'checkbox'
  | 'date'
  | 'switch'
  | 'slider';

// 表单字段基础接口
export interface FormField {
  type: FormFieldType;
  name: string;
  label: string;
  required?: boolean;
  disabled?: boolean;
  placeholder?: string;
  defaultValue?: any;
  validation?: ValidationRule[];
  options?: SelectOption[]; // 用于select/radio/checkbox
  props?: Record<string, any>; // 其他原生属性
}

// 选择项接口
export interface SelectOption {
  label: string;
  value: any;
  disabled?: boolean;
}

// 验证规则接口
export interface ValidationRule {
  validator: (value: any) => boolean;
  message: string;
}

// 表单数据接口
export interface FormData {
  [key: string]: any;
}

// 表单提交函数
export type SubmitHandler = (data: FormData) => void | Promise<void>;

